﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleFileManager.Manager
{
    public abstract class FilePanelItem : IFilePanelItem
    {
        private string _name;
        private IFolderIterator _iterator;
        private FilePanelItemType _type;

        protected IFolderIterator Iterator { get { return _iterator; } }
        public string Name { get { return _name; } }
        public abstract long Size { get; }
        public abstract DateTime LastAccessTime { get; }

        public virtual int Count
        {
            get
            {
                return 1;
            }
        }

        public FilePanelItemType Type
        {
            get
            {
                return _type;
            }
        }

        public FilePanelItem(string name)
        {
            _name = name;
        }

        public FilePanelItem(string name, FilePanelItemType type)
            : this(name)
        {
            _type = type;
        }

        public FilePanelItem(string name, FilePanelItemType type, IFolderIterator iterator)
            : this(name, type)
        {
            _iterator = iterator;
        }

        public abstract void Move(string path);

        public abstract void Create(string name);

        public abstract void Copy(string path);

        public abstract void MakeAction(SimpleFileManager.Manager.FileManager.FilePanel filePanel);

        public abstract void Delete();

        public abstract void Add(IFilePanelItem item);

        public abstract void Remove(IFilePanelItem item);

        public abstract void Rename(string newName);
    }
}
